package com.shenmazong.serverwebpoem.service.impl;

import com.shenmazong.serverwebpoem.mapper.ITbDynastyMapper;
import com.shenmazong.serverwebpoem.pojo.TbDynasty;
import com.shenmazong.serverwebpoem.service.TbDynastyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author 田不平
 * @project server-web-poem
 * @date 2020/3/24 9:15 AM
 * http://www.shenmazong.com
 */

@Slf4j
@Service
public class TbDynastyServiceImpl implements TbDynastyService {

    @Autowired
    ITbDynastyMapper iTbDynastyMapper;

    @Override
    public void add(TbDynasty dynasty) {
        iTbDynastyMapper.insert(dynasty);
    }

    @Override
    public void del(Integer id) {
        iTbDynastyMapper.deleteById(id);
    }

    @Override
    public void set(TbDynasty collection) {
        iTbDynastyMapper.updateById(collection);
    }

    @Override
    public TbDynasty getById(Integer id) {
        return iTbDynastyMapper.selectById(id);
    }
}
